package TestDemo.example.mapper;

import TestDemo.example.pojo.Student;
import TestDemo.example.pojo.StudentQueryParam;
import org.apache.ibatis.annotations.MapKey;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;


import java.util.ArrayList;
import java.util.Map;

@Mapper
public interface StudentMapper {
    public ArrayList<Student> getStudentParamList(StudentQueryParam studentQueryParam);

    void deleteById(ArrayList <Integer> ids);

    void add(Student student);

    @Select("select id, name, no, gender, phone, id_card, is_college, address, degree, graduation_date, clazz_id, violation_count, violation_score, create_time, update_time from student where id=#{id}")
    Student getById(Integer id);

    void updateStudent(Student student);

    void updateViolation(Integer id, Integer score);

    @MapKey("name")
    ArrayList<Map<String, Object>> getStudentDegreeData();

    @MapKey("cname")
    ArrayList<Map<String, Object>> getStudentCountData();
}
